﻿#region Imports
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading;
using System.Windows.Media;
using CommonUtilities.Attributes;
using SeriesEpisodeMapper.Converters;
#endregion Imports

namespace SeriesEpisodeMapper.Models
{
    public class EpisodeInfo : SeriesInfo
    {
        [SortIndex(1)]
        [DataImportMap("Season#")]
        public int SeasonIndex { get; set; }

        [SortIndex(2)]
        [DataImportMap("Episode#")]
        public int EpisodeIndex { get; set; }

        private string episodeTitle;
        [SortIndex(5)]
        [DataImportMap("Title")]
        public string EpisodeTitle
        {
            get { return episodeTitle; }
            set { episodeTitle = value; RaisePropertyChanged("EpisodeTitle"); }
        }

        private string fileNameFormatted;
        [Browsable(false)]
        public string FileNameFormatted
        {
            get { return fileNameFormatted; }
            set { fileNameFormatted = value; RaisePropertyChanged("FileNameFormatted"); }
        }

        private string _SEIndex;
        [Browsable(false)]
        public string SEIndex
        {
            get { return _SEIndex; }
            set { _SEIndex = value; RaisePropertyChanged("SEIndex"); }
        }

        private string parentFolder;
        [Browsable(false)]
        public string ParentFolder
        {
            get { return parentFolder; }
            set { parentFolder = value; RaisePropertyChanged("ParentFolder"); }
        }

        private IEnumerable<string> allExtns;
        [Browsable(false)]
        public IEnumerable<string> AllExtns
        {
            get { return allExtns; }
            set
            {
                allExtns = value; RaisePropertyChanged("AllExtns");
                AllExtnsText = new AllExtnConverter().Convert(allExtns, allExtns.GetType(), null, Thread.CurrentThread.CurrentCulture).ToString();
            }
        }

        private string allExtnsText;
        [Browsable(false)]
        public string AllExtnsText
        {
            get { return allExtnsText; }
            set { allExtnsText = value; RaisePropertyChanged("AllExtnsText"); }
        }

        private bool? isConverted;
        [Browsable(false)]
        public bool? IsConverted
        {
            get { return isConverted; }
            set { isConverted = value; RaisePropertyChanged("IsConverted"); }
        }

        private SolidColorBrush backColour = Brushes.Transparent;
        [Browsable(false)]
        public SolidColorBrush BackColour
        {
            get { return backColour; }
            set { backColour = value; RaisePropertyChanged("BackColour"); }
        }

        private SolidColorBrush seriesBackColour = Brushes.Transparent;
        [Browsable(false)]
        public SolidColorBrush SeriesBackColour
        {
            get { return seriesBackColour; }
            set { seriesBackColour = value; RaisePropertyChanged("SeriesBackColour"); }
        }

        private string infoTip;
        [Browsable(false)]
        public string InfoTip
        {
            get { return infoTip; }
            set { infoTip = value; RaisePropertyChanged("InfoTip"); }
        }
    }
}
